// import request from '@utils/request'
import request from '@/utils/request'

//  登录接口
export const loginAPI = (data) => request.post('/sys/login', data)

//  获取用户资料
export const getUserInfoAPI = () => request.get('/sys/profile')

// 修改用户密码
export const updatePasswordAPI = (data) => request.put('/sys/user/updatePass', data)

// 获取加密串,用来生成二维码-接口
export const getQrcodeKeyAPI = () => request.get('/sys/qrcodeKey')

// 获取加密串状态API

/** *
 * 获取扫码状态 多种状态- 1 未扫码 但是加密串未超时 2 已扫码但是未登录 3 已扫码并点登录 4 加密串失效或不存在 5 扫码后用户取消登录
 ***/
export const getQrcodeStateAPI = (params) => request.get('/sys/qrcodeState', { params })

// 更新头像裁剪的接口
export const updateUserStaffPhotoAPI = (data) => request.put('/sys/updateStaffPhoto', data)

// 群发通知接口
export const sendMultiMessageAPI = data => request.post('/sys/messageMuch', data)

// 删除用互信息
export const delUserMessageAPI = id => request.delete(`/sys/message/${id}`)

// 已读消息
export const updateUserMessageAPI = id => request.put(`/sys/message/${id}`)

// 获取用户消息
export const getUserMessageAPI = () => request.get('/sys/message')
